clear all

*add file path
gl do ""


* clean dataset with requests to be assigned to specific canton, only keep assignment during first 3 months, remove individuals with approved requests later on 
* comments.R codes text field
do "$do/comments.do"

* clean dataset ZEMIS 1994-2017 and merge in comment file
* saves file ZEMIS_start.dta
do "$do/clean.do"

* create group variables (nationality/ethnicity/language) at the canton or company level from ZEMIS data 
* crate file with a few nationalities to export to R to do maps
do "$do/extra_stat.do"

* create canton measurement of nationality network based on PETRA and STATPOP data
do "$do/canton.do"

* merge on canton and company level data and drop years and variables not used in final analysis
* saves file ZEMIS_final
do "$do/merge.do"

* run regressions
* create tables exported to R to do graphs
do "$do/regressions.do"

* run permutation test
* create tables exported to R to do graphs
do "$do/permutation_test.do"

* do graphs using file graphs.R
* do maps using file maps.R
